<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8"/>
    <title>Vue示例</title>
</head>

<body>
<div id="app">
    <child-component inline-template>
        <div>
            <h2>在父组件中定义子组件的模板</h2>
            <p>{{message}}</p>
            <p>{{msg}}</p>
        </div>
    </child-component>
</div>
<script charset="utf-8" src="../js/vue.min.js" type="text/javascript"></script>
<script type="text/javascript">
    Vue.component('child-component', {
        data: function () {
            return {
                msg: '在子组件声明的数据'
            }
        }
    });

    var app = new Vue({
        el: '#app',
        data: {
            message: '在父组件声明的数据'
        }
    })
</script>
</body>

</html>